////////////////////////////////////////////////////////////////////////////////
//
// Licensed under the MIT License
//
// Copyright (c) 2008 Chris Colinsky
// All Rights Reserved
//
// version	0.4
// http://code.google.com/p/sugarcookie/
// http://code.google.com/p/sugarcookie/wiki/License
//
////////////////////////////////////////////////////////////////////////////////

import sugarcookie.utils.ObjectUtil;
import sugarcookie.logger.Logger;

class sugarcookie.events.ThrownErrorEvent extends Object {
	private var _log:Logger;
	private var _msg:Object;
	
	public function ThrownErrorEvent(m:Object,isLogable:Boolean) {
		super();
		_log = Logger.getLog();
		_msg = m!=undefined?m:"Error";
		if (isLogable) _log.error(String(_msg));
	}
	
	public function get msg():Object {
		return _msg;
	}
	
	public function set msg(m:String):Void {
		_msg = m;
	}
	
	public function toString():String {
		return "Error: " + String(_msg);
	}
}